package com.atguigu.tingshu.album.mapper;

import com.atguigu.tingshu.model.album.AlbumStat;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Update;
import org.springframework.data.repository.query.Param;

@Mapper
public interface AlbumStatMapper extends BaseMapper<AlbumStat> {

    @Update("update album_stat stat set stat_num = stat_num+#{count} where album_id =#{albumId} and stat_type = #{play} and is_deleted = 0")
    void updateAlbumStat(@Param("count")Integer count, @Param("albumId") Long albumId, @Param("play")String play);
}
